import { getData, postData } from "@/utils/request";

/**
 * 我的分支
 */
export const getBranch = async (id) => {
    const res = await getData(`/sysOrganizationalStructure/queryOrganizationNameList/${id}`);
    return res;
};

/**
 * 用户认证
 * @param {*} data 
 */
export const certification = async (data) => {
    const res = await postData('/sysWxUser/auth', data);
    return res;
};

/**
 * 获取所有的组织以及所属上级
 */
export const getAllOrigin = async () => {
    const res = await getData('/sysOrganizationalStructure/queryOrganizationChoice');
    return res;
};

/**
 * 获取所有的职务
 */
export const getAllPositions = async () => {
    const res = await getData('/sysPost/getArticles');
    return res;
};
/**
 * 查询用户的收藏文章
 * @param {*} id 
 */
export const getFavoriteArticles = async (id) => {
    const res = await getData(`/wxUserCollect/getArticles/${id}`);
    return res;
};

/**
 * 修改个人信息
 * @param {*} data 
 */
export const updateUserInfo = async (data) => {
    const res = await postData('/sysWxUser/update', data);
    return res;
};

/**
 * 展示志愿者活动
 * @param {*} data 
 */
export const showVolunteerData = async (data) => {
    const res = await postData('/serviceVolunteerActivity/queryVolunteerActivityItemList', data);
    return res;
};